# uamcf/adapters/__init__.py
from .base import ModelAdapter
from .pytorch import PyTorchAdapter
from .tensorflow import TensorFlowAdapter
from .onnx import ONNXAdapter
from .tflite import TFLiteAdapter

# 注册所有适配器
ADAPTER_REGISTRY = {
    "pytorch": PyTorchAdapter,
    "tensorflow": TensorFlowAdapter,
    "onnx": ONNXAdapter,
    "tflite": TFLiteAdapter
}

def get_adapter(adapter_name):
    """获取适配器实例"""
    adapter_cls = ADAPTER_REGISTRY.get(adapter_name)
    if adapter_cls:
        return adapter_cls()
    return None

def register_adapter(name, adapter_cls):
    """注册新的适配器"""
    ADAPTER_REGISTRY[name] = adapter_cls

__all__ = [
    'ModelAdapter',
    'PyTorchAdapter',
    'TensorFlowAdapter',
    'ONNXAdapter',
    'TFLiteAdapter',
    'get_adapter',
    'register_adapter'
]